package com.example.learnvitamio

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.example.learnvitamio.base.BaseActivity
import com.example.learnvitamio.databinding.ActivityMainBinding
import com.example.learnvitamio.live.LiveStreamingActivity

class MainActivity : BaseActivity<ActivityMainBinding>(),View.OnClickListener {


    override fun ActivityMainBinding.initBinding() {
        btnMediaInfo.setOnClickListener(this@MainActivity)
        btnPlayVideo.setOnClickListener(this@MainActivity)
        btnMediaDemo.setOnClickListener(this@MainActivity)
        btnLiveStreaming.setOnClickListener(this@MainActivity)
    }

    override fun onClick(v: View?) {
        when(v?.id){
            mBinding.btnMediaInfo.id -> startActivity(Intent(this,MediaMetadataActivity::class.java))
            mBinding.btnPlayVideo.id -> startActivity(Intent(this,VideoViewDemo::class.java))
            mBinding.btnMediaDemo.id -> startActivity(Intent(this,MediaPlayerDemo::class.java))
            mBinding.btnLiveStreaming.id -> startActivity(Intent(this,LiveStreamingActivity::class.java))
        }
    }

}